package com.mobilekites.ad;

import android.app.Activity;

import com.fovai.xshys160051.AdListener;
import com.fovai.xshys160051.AdListener.AdType;
import com.fovai.xshys160051.AdView;
import com.fovai.xshys160051.MA;

public interface Airpush extends CircleLifeActivity {
	public AdView getAdView();

	public static class AirpushPlayStore implements Airpush {
		private MA ma;
		private Activity mActivity;

		public AirpushPlayStore(Activity activity) {
			mActivity = activity;
			ma = new MA(activity, adListener, true);
		}

		@Override
		public void onCreate() {
			// MA.setOptinListener(null);

			ma.callAppWall();
			// try {
			// ma.showCachedAd(mActivity, AdType.appwall);
			// } catch (Exception e) {
			// e.printStackTrace();
			// }
		}

		@Override
		public void onStart() {

		}

		@Override
		public void onResume() {

		}

		@Override
		public void onPause() {

		}

		@Override
		public void onStop() {

		}

		@Override
		public void onBackPressed() {
			try {
				ma.showCachedAd(mActivity, AdType.smartwall);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		@Override
		public void onDestroy() {
			mActivity = null;
			ma = null;
		}

		AdListener adListener = new AdListener() {

			@Override
			public void onSmartWallAdShowing() {

			}

			@Override
			public void onSmartWallAdClosed() {

			}

			@Override
			public void onSDKIntegrationError(String arg0) {

			}

			@Override
			public void onAdError(String arg0) {

			}

			@Override
			public void onAdCached(AdType arg0) {
			}

			@Override
			public void noAdAvailableListener() {

			}
		};

		@Override
		public AdView getAdView() {
			AdView mAdView = new AdView(mActivity,
					AdView.BANNER_TYPE_IN_APP_AD,
					AdView.PLACEMENT_TYPE_INTERSTITIAL, false, false,
					AdView.ANIMATION_TYPE_LEFT_TO_RIGHT);
			return mAdView;
		}

	}
}
